#include <iostream>
#include <future>
#include<unistd.h>
int work() { 
    std::cout << "working..." << std::endl;
    sleep(3);
    return 42; 
}

int main() {
    std::future<int> f1 = std::async(std::launch::async, work);
    std::cout << "hello" << std::endl;   // 或者 std::cout << "hello\n";
    int result = f1.get();               // 等待并取结果
    std::cout << result << std::endl;
    return 0;
}